package ua.com.stormlabs.jnardi.controller;

import ua.com.stormlabs.jnardi.model.Board;
import ua.com.stormlabs.jnardi.model.Chip;
import ua.com.stormlabs.jnardi.view.BoardForm;
import ua.com.stormlabs.jnardi.view.ChipLabel;

import java.util.Map;
import java.util.List;
import java.util.HashMap;

import org.apache.log4j.Logger;

/**
 * User: denis
 * Date: Mar 25, 2009
 */
public class BoardManager {

    private static final Logger log = Logger.getLogger(BoardManager.class);

    private Map<Chip, ChipLabel> chipsMap;

    public void startGame() {
        Board board = new Board();
        BoardForm boardForm = new BoardForm();
        List<Chip> chips = board.getChips();
        chipsMap = new HashMap<Chip, ChipLabel>();
        for (Chip chip : chips) {
            ChipLabel chipLabel = boardForm.createChipLabel(chip.getColor(), chip.getCell(), chip.getLevel());
            chipsMap.put(chip, chipLabel);
        }
        boardForm.show();
    }
}
